package com.star.system.config;

import com.star.security.authentication.AuthenticationToken;
import com.star.security.authentication.AuthenticationService;
import com.star.system.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 本地认证服务
 *
 * @author yangzj
 */
@Service
public class LocalAuthenticationServiceImpl implements LocalAuthenticationService {

    @Autowired
    private AuthenticationService authenticationService;

    @Override
    public void logout(User user) {
        authenticationService.logout(AuthenticationToken.refresh(user));
    }

    @Override
    public void refresh(User user) {
        authenticationService.refresh(AuthenticationToken.refresh(user));
    }
}
